﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Forms/FormAdmin.master" AutoEventWireup="true" CodeBehind="FormList.aspx.cs" Inherits="HRdex_Final.Forms.WebForm1" %>
<asp:Content ID="pCBa" ContentPlaceHolderID="MainContent" runat="server">
   
    <div align="center">
    <div>
            <asp:Button ID="btnLeave" runat="server" Text="Leave" Height="25px" 
                onclick="btnLeave_Click" Width="160px" />
            <asp:Button ID="btnCBA" runat="server" Text="CBA" Height="25px" 
                onclick="btnCBA_Click" Width="160px" />
            <asp:Button ID="btnFlexi" runat="server" Text="Flexi" Height="25px" 
                onclick="btnFlexi_Click" Width="160px" />
            <asp:Button ID="btnSubstitution" runat="server" Text="Substitution" 
                Height="25px" onclick="btnSubstitution_Click" Width="160px" />
            <asp:Button ID="btnNoA" runat="server" Text="Notice of Absence" Height="25px" 
                onclick="btnNoA_Click" Width="160px" />
            <asp:Button ID="btnDownload" runat="server" Text="Downloadable Forms" 
                Height="25px" onclick="btnDownload_Click" Width="160px" />
        
    </div>
      <asp:Panel ID="pCBAlist" runat="server">
          <asp:GridView ID="gvCBA" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="formCBAID" DataSourceID="cba" BackColor="White" 
          BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
    CellPadding="3">
              <Columns>
                  <asp:TemplateField>
                      <ItemTemplate>
                          <asp:HyperLink ID="lnkSelect" runat='server' 
        NavigateUrl='<%# String.Format("~/Forms/CBAform.aspx?formCBAID={0}", Eval("formCBAID")) %>'>Select</asp:HyperLink>
                      </ItemTemplate>
                  </asp:TemplateField>
                  <asp:BoundField DataField="formCBAID" HeaderText="formCBAID" 
                InsertVisible="False" ReadOnly="True" SortExpression="formCBAID" />
                  <asp:BoundField DataField="Employee ID" HeaderText="Employee ID" 
                SortExpression="Employee ID" />
                  <asp:BoundField DataField="Employee Name" HeaderText="Employee Name" 
                SortExpression="Employee Name" ReadOnly="True" />
                  <asp:BoundField DataField="Student Number" HeaderText="Student Number" 
                SortExpression="Student Number" />
                  <asp:BoundField DataField="Beneficiary" HeaderText="Beneficiary" 
                SortExpression="Beneficiary" />
                  <asp:BoundField DataField="HR Approval" HeaderText="HR Approval" 
                SortExpression="HR Approval" />
              </Columns>
              <FooterStyle BackColor="White" ForeColor="#000066" />
              <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
              <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
              <RowStyle ForeColor="#000066" />
              <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
              <SortedAscendingCellStyle BackColor="#F1F1F1" />
              <SortedAscendingHeaderStyle BackColor="#007DBB" />
              <SortedDescendingCellStyle BackColor="#CAC9C9" />
              <SortedDescendingHeaderStyle BackColor="#00547E" />
          </asp:GridView>
          <asp:SqlDataSource ID="cba" runat="server" 
              ConnectionString="<%$ ConnectionStrings:HRmainConnectionString %>" 
              SelectCommand="SELECT formCBA.formCBAID, formCBA.EmployeeID AS [Employee ID], formEmployees.LastName + ', ' + formEmployees.FirstName + ' ' + formEmployees.MiddleName AS [Employee Name], formCBA.StudentNo AS [Student Number], formCBA.StudentName AS Beneficiary, formCBA.HRApproval AS [HR Approval] FROM formCBA INNER JOIN formEmployees ON formCBA.EmployeeID = formEmployees.EmployeeID WHERE (formCBA.EmployeeID = @EmployeeID)">
              <SelectParameters>
                  <asp:SessionParameter Name="EmployeeID" SessionField="EmployeeID" />
              </SelectParameters>
          </asp:SqlDataSource>
      </asp:Panel>
    
    <asp:Panel ID="pLeave" runat="server">
        Leave List<br />
        <%--<asp:TemplateField>
<ItemTemplate> 
<asp:HyperLink ID="lnkSelect" runat='server' NavigateUrl='<%# String.Format("~/Forms/LeaveForm.aspx?LeaveID={0}", Eval("LeaveID")) %>'>Select</asp:HyperLink> 
</ItemTemplate> 
</asp:TemplateField>--%>
        <asp:GridView ID="gvLeave" runat="server" 
    AutoGenerateColumns="False" DataKeyNames="LeaveID" DataSourceID="listLeave" 
            BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
            CellPadding="3" AllowPaging="True" AllowSorting="True">
            <Columns>
    <asp:TemplateField>
<ItemTemplate> 
<asp:HyperLink ID="lnkSelect" runat='server' NavigateUrl='<%# String.Format("~/Forms/LeaveForm.aspx?LeaveID={0}", Eval("LeaveID")) %>'>Select</asp:HyperLink> 
</ItemTemplate> 
</asp:TemplateField>
                <asp:BoundField DataField="LeaveID" HeaderText="LeaveID" InsertVisible="False" 
            ReadOnly="True" SortExpression="LeaveID" />
                <asp:BoundField DataField="Name" HeaderText="Name" ReadOnly="True" 
            SortExpression="Name" />
                <asp:BoundField DataField="From" HeaderText="From" 
            SortExpression="From" />
                <asp:BoundField DataField="To" HeaderText="To" 
            SortExpression="To" />
                <asp:BoundField DataField="Head Approval" HeaderText="Head Approval" 
            SortExpression="Head Approval" />
                <asp:BoundField DataField="Dean/Director Approval" 
                    HeaderText="Dean/Director Approval" 
                    SortExpression="Dean/Director Approval" />
                <asp:BoundField DataField="HR Approval" HeaderText="HR Approval" 
            SortExpression="HR Approval" />
            </Columns>
            <FooterStyle BackColor="White" ForeColor="#000066" />
            <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
            <RowStyle ForeColor="#000066" />
            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#007DBB" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#00547E" />
        </asp:GridView>
        <asp:SqlDataSource ID="listLeave" runat="server" 
    ConnectionString="<%$ ConnectionStrings:HRmainConnectionString %>" 
            SelectCommand="SELECT formLeave.LeaveID, formEmployees.LastName + ', ' + formEmployees.FirstName + ' ' + formEmployees.MiddleName AS Name, formLeave.fromDateTime AS [From], formLeave.toDateTime AS [To], formLeave.HeadApproval AS [Head Approval], formLeave.DeanApproval AS [Dean/Director Approval], formLeave.HRApproval AS [HR Approval] FROM formLeave INNER JOIN formEmployees ON formLeave.EmployeeID = formEmployees.EmployeeID WHERE (formEmployees.EmployeeID = @EmployeeID)">
            <SelectParameters>
                <asp:SessionParameter Name="EmployeeID" SessionField="EmployeeID" />
            </SelectParameters>
        </asp:SqlDataSource>
    </asp:Panel>

    <asp:Panel ID="pFlexiForm" runat="server">
        Flexi Form<br />
        <br />



        <asp:SqlDataSource ID="FlexiForm" runat="server" 
            ConnectionString="<%$ ConnectionStrings:HRmainConnectionString %>" 
            
            
            
            
            SelectCommand="SELECT formFlexi.FlexiID, formEmployees.LastName + ', ' + formEmployees.FirstName + ' ' + formEmployees.MiddleName AS Name, formFlexi.OriginalDate AS [Original Date], formFlexi.OriginalTime AS [Original Time], formFlexi.FlexiDate AS [Flexi Date], formFlexi.FlexiTime AS [Flexi Time], formFlexi.pubDate AS [Published Date], formFlexi.HeadApproval AS [Head Approval], formFlexi.DeanApproval AS [Dean/Director Approval], formFlexi.HRApproval AS [HR Approval] FROM formFlexi INNER JOIN formEmployees ON formFlexi.EmpID = formEmployees.EmployeeID AND formFlexi.EmpID = formEmployees.EmployeeID WHERE (formEmployees.EmployeeID = @EmployeeID)">
            <SelectParameters>
                <asp:SessionParameter Name="EmployeeID" SessionField="EmployeeID" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:GridView ID="gvFlexi" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
            BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
            DataKeyNames="FlexiID" DataSourceID="FlexiForm">
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:HyperLink ID="lnkSelect" runat="server" 
                            NavigateUrl='<%# String.Format("~/Forms/FlexiForm.aspx?FlexiID={0}", Eval("FlexiID")) %>'>Select</asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="FlexiID" HeaderText="FlexiID" InsertVisible="False" 
                    ReadOnly="True" SortExpression="FlexiID" />
                <asp:BoundField DataField="Name" HeaderText="Name" ReadOnly="True" 
                    SortExpression="Name" />
                <asp:BoundField DataField="Original Date" HeaderText="Original Date" 
                    SortExpression="Original Date" />
                <asp:BoundField DataField="Original Time" HeaderText="Original Time" 
                    SortExpression="Original Time" />
                <asp:BoundField DataField="Flexi Date" HeaderText="Flexi Date" 
                    SortExpression="Flexi Date" />
                <asp:BoundField DataField="Flexi Time" HeaderText="Flexi Time" 
                    SortExpression="Flexi Time" />
                <asp:BoundField DataField="Published Date" HeaderText="Published Date" 
                    SortExpression="Published Date" />
                <asp:BoundField DataField="Head Approval" HeaderText="Head Approval" 
                    SortExpression="Head Approval" />
                <asp:BoundField DataField="Dean/Director Approval" 
                    HeaderText="Dean/Director Approval" SortExpression="Dean/Director Approval" />
                <asp:BoundField DataField="HR Approval" HeaderText="HR Approval" 
                    SortExpression="HR Approval" />
            </Columns>
            <FooterStyle BackColor="White" ForeColor="#000066" />
            <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
            <RowStyle ForeColor="#000066" />
            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#007DBB" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#00547E" />
        </asp:GridView>
    </asp:Panel>
    <asp:Panel ID="pSubstitution" runat="server">
        Substitution Form<br />
        <asp:GridView ID="gvNoA0" runat="server" AllowPaging="True" AllowSorting="True" 
            AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" 
            BorderStyle="None" BorderWidth="1px" CellPadding="3" 
            DataKeyNames="SubstitutionID" DataSourceID="listSubstitution">
            <Columns>
             <asp:TemplateField>
<ItemTemplate> 
<asp:HyperLink ID="lnkSelect" runat='server' NavigateUrl='<%# String.Format("~/Forms/SubstitutionForm.aspx?SubstitutionID={0}", Eval("SubstitutionID")) %>'>Select</asp:HyperLink> 
</ItemTemplate> 
</asp:TemplateField>
                <asp:BoundField DataField="SubstitutionID" HeaderText="SubstitutionID" 
                    InsertVisible="False" ReadOnly="True" SortExpression="SubstitutionID" />
                <asp:BoundField DataField="Name" HeaderText="Name" ReadOnly="True" 
                    SortExpression="Name" />
                <asp:BoundField DataField="Department" HeaderText="Department" 
                    SortExpression="Department" />
                <asp:BoundField DataField="Head Approval" HeaderText="Head Approval" 
                    SortExpression="Head Approval" />
                <asp:BoundField DataField="Dean/Director Approval" 
                    HeaderText="Dean/Director Approval" SortExpression="Dean/Director Approval" />
                <asp:BoundField DataField="HR Approval" HeaderText="HR Approval" 
                    SortExpression="HR Approval" />
            </Columns>
            <FooterStyle BackColor="White" ForeColor="#000066" />
            <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
            <RowStyle ForeColor="#000066" />
            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#007DBB" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#00547E" />
        </asp:GridView>
        <br />

        

        <asp:SqlDataSource ID="listSubstitution" runat="server" 
            ConnectionString="<%$ ConnectionStrings:HRmainConnectionString %>" 
            
            
            
            
            SelectCommand="SELECT formSubstitution.SubstitutionID, formEmployees.LastName + ', ' + formEmployees.FirstName + ' ' + formEmployees.MiddleName AS Name, catDepartment.DepartmentName AS Department, formSubstitution.HeadApproval AS [Head Approval], formSubstitution.DeanApproval AS [Dean/Director Approval], formSubstitution.HRApproval AS [HR Approval] FROM formSubstitution INNER JOIN formEmployees ON formSubstitution.EmpID = formEmployees.EmployeeID INNER JOIN catDepartment ON formSubstitution.DeptID = catDepartment.DeptID AND formEmployees.DeptID = catDepartment.DeptID WHERE (formEmployees.EmployeeID = @EmployeeID)">
            <SelectParameters>
                <asp:SessionParameter Name="EmployeeID" SessionField="EmployeeID" />
            </SelectParameters>
        </asp:SqlDataSource>
    </asp:Panel>
    <asp:Panel ID="pNoA" runat="server">
        Notice of Absence<br />
       
        <asp:GridView ID="gvNoA" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="NoticeOfAbsenceID" DataSourceID="listNoA" BackColor="White" 
            BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
            AllowPaging="True" AllowSorting="True">
            <Columns>
 <asp:TemplateField>
<ItemTemplate> 
<asp:HyperLink ID="lnkSelect" runat='server' NavigateUrl='<%# String.Format("~/Forms/NoticeOfAbsence.aspx?NoticeOfAbsenceID={0}", Eval("NoticeOfAbsenceID")) %>'>Select</asp:HyperLink> 
</ItemTemplate> 
</asp:TemplateField>
                <asp:BoundField DataField="NoticeOfAbsenceID" HeaderText="NoticeOfAbsenceID" InsertVisible="False" 
                    ReadOnly="True" SortExpression="NoticeOfAbsenceID" />
                <asp:BoundField DataField="Name" HeaderText="Name" ReadOnly="True" 
                    SortExpression="Name" />
                <asp:BoundField DataField="Department" HeaderText="Department" 
                    SortExpression="Department" />
                <asp:BoundField DataField="Published Date" HeaderText="Published Date" 
                    SortExpression="Published Date" />
                <asp:BoundField DataField="Approval" HeaderText="Approval" 
                    SortExpression="Approval" />
            </Columns>
            <FooterStyle BackColor="White" ForeColor="#000066" />
            <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
            <RowStyle ForeColor="#000066" />
            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#007DBB" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#00547E" />
        </asp:GridView>

        <asp:SqlDataSource ID="listNoA" runat="server" 
            ConnectionString="<%$ ConnectionStrings:HRmainConnectionString %>" 
            
            
            
            
            SelectCommand="SELECT formNoticeofAbsence.NoticeOfAbsenceID, formEmployees.LastName + ', ' + formEmployees.FirstName + ' ' + formEmployees.MiddleName AS Name, catDepartment.DepartmentName AS Department, formNoticeofAbsence.pubDateReturn AS [Published Date], formNoticeofAbsence.FacApproval AS Approval FROM formNoticeofAbsence INNER JOIN formEmployees ON formNoticeofAbsence.ForEmpID = formEmployees.EmployeeID INNER JOIN catDepartment ON formEmployees.DeptID = catDepartment.DeptID WHERE (formEmployees.EmployeeID = @EmployeeID)">
            <SelectParameters>
                <asp:SessionParameter Name="EmployeeID" SessionField="EmployeeID" />
            </SelectParameters>
        </asp:SqlDataSource>
    </asp:Panel>
      <asp:Panel ID="pDownload" runat="server">
          <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
              DataSourceID="download">
              <Columns>
                  <asp:BoundField DataField="downloadID" HeaderText="downloadID" 
                      InsertVisible="False" ReadOnly="True" SortExpression="downloadID" />
                  <asp:BoundField DataField="dLoadName" HeaderText="dLoadName" 
                      SortExpression="dLoadName" />
                  <asp:BoundField DataField="dLoadType" HeaderText="dLoadType" 
                      SortExpression="dLoadType" />
              </Columns>
          </asp:GridView>
          <asp:SqlDataSource ID="download" runat="server" 
              ConnectionString="<%$ ConnectionStrings:HRmainConnectionString %>" 
              SelectCommand="SELECT * FROM [formDownload]"></asp:SqlDataSource>
      </asp:Panel>
</div> 
</asp:Content>
